/**
 * Created by sun on 2016/8/4.
 */
define(function (require) {
    var app = require('/../js/app');
    require('ui-table');

    app.useModule("ui.table");

    var datepicker = require('datepicker');


    app.controller('sys_contracts_typeCtrl', ['$scope','$http' ,function ($scope, $http) {
        $scope.orderParams = {
            url: "/admin/contractsType/list"
        };
        datepicker($scope);

        //全局查询
        $scope.search = function() {
            $scope.ctrlScope.trend.beginDate=$filter('date')($scope.ctrlScope.trend.beginDate,'yyyy-MM-dd');
            $scope.ctrlScope.trend.endDate=$filter('date')($scope.ctrlScope.trend.endDate,'yyyy-MM-dd');
            //表格查询参数设置
            $scope.orderParams.ajaxParam=$scope.ctrlScope.trend;

            //表格刷新
            $scope.orderParams.reload();
        };

        //全局查询重置
        $scope.reset=function(){

            $scope.search();
        };
    }]);


});